unit INamedDeviceSocketClient;

interface
uses
  INamedDeviceClient;

type
  EOINamedDeviceSocketClient = class(EOINamedDeviceClient)
  private

  protected
    procedure doOpen; override;

  public

  end;

implementation
uses
  IIONamedDeviceThread,
  IOPortSocket,
  blcksock;

procedure EOINamedDeviceSocketClient.doOpen;
var
  tmpSocket: TTCPBlockSocket;
  tmpPort: EOIOPortSocket;
begin
  tmpSocket := TTCPBlockSocket.Create;
  tmpSocket.Connect(DeviceIP, DevicePort);
  if tmpSocket.LastError = 0 then begin
    tmpPort := EOIOPortSocket.Create(DeviceName, tmpSocket);
    FIONamedDeviceThread := EOIONamedDeviceThread.Create(Self, tmpPort);
    FIONamedDeviceThread.FreeOnTerminate := True;
    FIONamedDeviceThread.Resume;
    FDisconnected := False;
  end
  else
    FIONamedDeviceThread := Nil;
end;

end.

